package com.wwwarehouse.usercenter.adapter;

import android.graphics.Canvas;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.wwwarehouse.usercenter.R;


/**
 * @author : mundane
 * @time : 2017/9/20 14:51
 * @description :
 * @file : AuthorityDistributeRvItemDecoration.java
 */

public class AuthorityDistributeRvItemDecoration extends RecyclerView.ItemDecoration {
	public AuthorityDistributeRvItemDecoration() {
	}

	@Override
	public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
		super.onDraw(c, parent, state);
	}

	@Override
	public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
		super.onDrawOver(c, parent, state);
	}

	@Override
	public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
		super.getItemOffsets(outRect, view, parent, state);
		outRect.top = parent.getResources().getDimensionPixelOffset(R.dimen.usercenter_dimen_dp15);
//		int position = parent.getChildAdapterPosition(view);
//		if (position % 3 == 0) {
//			outRect.left = parent.getResources().getDimensionPixelOffset(R.dimen.common_dimen_dp14);
//			outRect.right = parent.getResources().getDimensionPixelOffset(R.dimen.common_dimen_dp7);
//		} else if (position % 3 == 1) {
//			outRect.left = parent.getResources().getDimensionPixelOffset(R.dimen.common_dimen_dp7);
//			outRect.right = parent.getResources().getDimensionPixelOffset(R.dimen.common_dimen_dp7);
//		} else {
//			outRect.left = parent.getResources().getDimensionPixelOffset(R.dimen.common_dimen_dp7);
//			outRect.right = parent.getResources().getDimensionPixelOffset(R.dimen.common_dimen_dp14);
//		}
	}
}
